package org.dtrd.modules.flup.entity.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.config.system.Constant;
import org.dtrd.modules.flup.entity.po.DtrdEntRdFlupAppointmentRecord;

import java.util.Date;


/**
 * <p>
 * 复诊预约记录
 * </p>
 *
 * @author QR
 * @since 2021-12-16
 */
@ApiModel(value = "预约记录", description = "用于患者列表处展示")
@Getter
@Setter
public class FlupRecord {

    private Integer dataId;

    @ApiModelProperty("机构编码")
    private String orgCode;

    @ApiModelProperty("医生id")
    private Integer doctorId;

    @ApiModelProperty("患者id")
    private Integer patientId;

    @ApiModelProperty("复诊预约日期")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern ="yyyy-MM-dd", timezone ="GMT+8")
    private Date flupDate;

    @ApiModelProperty("复诊预约时间段")
    private Integer flupTime;

    @ApiModelProperty("复诊模版id")
    private Integer flupTemplateId;

    @ApiModelProperty("复诊状态, 0-未预约, 1-待复诊, 2-已复诊, 3-未复诊, 4-复诊中")
    private Integer flupStatus = 0;
    @ApiModelProperty("复诊状态文本")
    private String flupStatusText = "暂无预约记录";

    @ApiModelProperty("复诊实际开始时间")
    private Date flupRealStartTime;

    @ApiModelProperty("复诊实际结束时间")
    private Date flupRealEndTime;

    @ApiModelProperty("备注")
    private String remark;

    public FlupRecord() {}

    public FlupRecord(DtrdEntRdFlupAppointmentRecord po){
        this.dataId = po.getDataId();
        this.orgCode = po.getOrgCode();
        this.patientId = po.getPatientId();
        this.doctorId = po.getDoctorId();
        this.flupDate = po.getFlupDate();
        this.flupTime = po.getFlupTime();
        this.flupTemplateId = po.getFlupTemplateId();
        Integer status = po.getFlupStatus();
        if (status != null) {
            this.flupStatus = status;
            this.flupStatusText = Constant.FlupStatus.valueOf(status).getName();
        }
        this.remark = po.getRemark();
        this.flupRealStartTime = po.getFlupRealStartTime();
        this.flupRealEndTime = po.getFlupRealEndTime();
    }

}
